
export function success(data?: object, ...ages: any[]) {
  let returnData = {
    success: true,
    data: data ? data : {},
  }
  if(ages.length) {
    ages.map(age => {
      Object.keys(age).map(key => {
        returnData[key] = age[key];
      });
    })
  }
  return returnData;
}

export function error(message: string, ...ages: any[]) {
  let returnData = {
    success: false,
    message,
  }
  if(ages.length) {
    ages.map(age => {
      Object.keys(age).map(key => {
        returnData[key] = age[key];
      });
    })
  }
  return JSON.stringify(returnData);
}